package thread;

public class Bank {
    private int account=2100;
    public  boolean getMoney(int money){
        int account=getAccount();
        if(account>=money){
            account=account-money;
            Thread.yield();

        }
        saveAccount(account);
        return true;
    }
    public void saveAccount(int account) {
        this.account = account;
    }
    public int getAccount() {
        return account;
    }
}
